package cn.org.channl.server.handler;

import io.netty.channel.ChannelInitializer;
import io.netty.channel.socket.SocketChannel;
import io.netty.handler.logging.LogLevel;
import io.netty.handler.logging.LoggingHandler;
public class ServerThreadPipeline extends ChannelInitializer<SocketChannel> {

	public static final LoggingHandler loggingHandler = new LoggingHandler(LogLevel.INFO);
	
	@Override
	protected void initChannel(SocketChannel ch) {
//		ch.pipeline().addLast("idleStateHandler",new IdleStateHandler(180, 0, 0));   //心跳
		ch.pipeline().addLast(loggingHandler);     					//日志
		ch.pipeline().addLast(new BaseMessageIdHandler());         	//基于MessageId的长度处理,解决断包粘包
		ch.pipeline().addLast(new BusinessHandler());    			//业务逻辑处理
	}
}
